//
//  CollectCell.m
//  FKGW
//
//  Created by song ce on 2017/2/20.
//  Copyright © 2017年 song ce. All rights reserved.
//

#import "CollectCell.h"
#import "OSSHelper.h"
@implementation CollectCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.selectionStyle= UITableViewCellSelectionStyleNone;
     self.xOssProcess =  [NSString stringWithFormat:@"image/resize,m_fill,w_%d,h_%d",67,70];
}

-(void)setModel:(CollectModel *)model{
    _model = model;
    self .goodsNameLabel.text = _model.pName;
    [[OSSHelper sharedHelper] OSSDownLoadWithObjectKey:_model.pPic xOssProcess:self.xOssProcess downLoadBlock:^(NSData *data) {
        dispatch_async(dispatch_get_main_queue(), ^{
            self.goodsImageV.image = [UIImage imageWithData:data];
        });
    }];

    self.priceLabel.text = [NSString stringWithFormat:@"￥ %@",_model.pPrice];
    self.standardLabel.text = _model.pIntroduce;
}

//取消收藏
- (IBAction)cancelBtn:(UIButton *)sender {
    if(self.cancelCollectBlock){
        self.cancelCollectBlock();
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
